module Piston
  module Edit
    class OpenFile
      def initialize(file)
        @file = file
      end

      def open
        xaml_file = File.join(File.expand_path(File.dirname(__FILE__)), '../view/edit.xaml')
        document = System::Windows::Markup::XamlReader.load_file xaml_file

        workspace = Piston::Workspace.instance
        workspace.file_view.add document
      end
    end
  end
end